import {defineStore} from 'pinia'
import { ref } from 'vue'

//用户模块token,serToken,removeToken,getToken
export const useUserStore = defineStore('user', () => {
  const token = ref('')
  const id = ref('')
  const userName = ref('')
  const setToken = (newToken)=>{token.value = newToken}
  const setId = (newToken)=>{id.value = newToken}
  const setUserName = (newToken)=>{userName.value = newToken}
  return {
    token,
    id,
    userName,
    setToken,
    setId,
    setUserName,
  }
},
  {
    persist: true
  }
)
